<template>
	<view>
		<u-navbar title="充电记录"></u-navbar>
		<formz ref="formz" :data="data" :inputs="inputs"></formz>
		<view style="width: 200px; margin: 20rpx auto">
			<u-button type="primary" @click="search" :loading="loading">
				{{ $z.$t("搜索") }}
			</u-button>
		</view>
		<useritem v-for="(item, key) in searchlist" :key="key" :item="item"></useritem>
	</view>
</template>

<script>
	import json from "./json";
	import useritem from "./components/useritem.vue";
	export default {
		components: {
			useritem,
		},
		data() {
			return {
				loading: false,
				inputs: json.searchjson,
				searchlist: [],
				searchfalg: false,
				query: {},
				data: {},
			};
		},
		onLoad(query) {
			this.query = query;
			this.init();
		},
		methods: {
			async init() {},

			async search() {
				let data = await this.$refs.formz.validate();
				let searchdata = {
					...data,
				};
				for (let key in searchdata) {
					if (searchdata[key] == "") {
						delete searchdata[key];
					}
				}
				this.searchlist = await this.$z.request("/GetRfCD", searchdata);
			},
		},
	};
</script>

<style lang="scss" scoped>
	.iconright {
		width: 88rpx;
		height: 88rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		margin-right: -26rpx;
	}
</style>